/**
 * 
 */
package org.xlab.familystore.domain;

import java.io.Serializable;
import java.util.Date;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * @author makubex
 * 
 */
@DatabaseTable(tableName="COMMODITY_")
public class Commodity implements Serializable {
	/**
	 * @serialField
	 */
	private static final long serialVersionUID = -7754420005346433835L;
	@DatabaseField(generatedId = true)
	private int id;
	@DatabaseField(unique = true)
	private String name;
	@DatabaseField
	private Date createdTime;
	@DatabaseField
	private Date lastUpdatedTime;
	@DatabaseField(foreign = true, canBeNull = false)
	private SecondCategory category;

	public Date getLastUpdatedTime() {
		return lastUpdatedTime;
	}

	public void setLastUpdatedTime(Date lastUpdatedTime) {
		this.lastUpdatedTime = lastUpdatedTime;
	}

	public Commodity() {
		// needed by ormlite
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getCreatedTime() {
		return createdTime;
	}

	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}

	public SecondCategory getCategory() {
		return category;
	}

	public void setCategory(SecondCategory category) {
		this.category = category;
	}

}
